$(function() // run after page loads
{
  $(".buying").click(function()
  { // first click hides login form, shows password recovery 
       $(".everything").show(); 
$('.everything').delay(200).animate({'left': '50%', 'margin-left': '-375px'},550);
$('.buyorsell').fadeOut(300);
  });
}); 

$(function() // run after page loads
{
  $(".selling").click(function()
  { // first click hides login form, shows password recovery 
$('.sellingField').delay(350).fadeIn(600);
$('.buyorsell').fadeOut(300);
  });
}); 

$(function() // run after page loads
{
  $(".yourgreetings").click(function()
  { // first click hides login form, shows password recovery
  $(".yourgreetings").css({backgroundColor: ''}); 
  $(this).css({backgroundColor: '#eff2f7'}); 
  $(".YourResponses").hide();	
  $(".content1").fadeOut(300);					 
  $(".content2").fadeOut(300);					 
  $(".introBAS").fadeOut(300);					 
  $(this).next().delay(300).fadeIn(300);
  $(".box2").fadeOut(300); 
  $(".box3").fadeOut(300); 
  });
}); 

$(function() // run after page loads
{
  $(".responses2").click(function()
  { // first click hides login form, shows password recovery
  $(".responses2").css({backgroundColor: ''}); 
  $(".responses2").show();
  $(this).css({backgroundColor: '#eff2f7'}); 
  $(this).next().css({backgroundColor: '#eff2f7'}); 
  $(".yourgreetings").css({backgroundColor: ''}); 
  $(".box3").fadeOut(300);
  $(".box2").fadeOut(300);
  $(".YourResponses").fadeOut(300);
  $(".content2").fadeOut(300);
  $(".content1").fadeOut(300);
  $(".introBAS").fadeOut(300);
  $(this).next().next().animate({height: '398px'},100);  					
  $(this).next().delay(600).slideToggle(300);					
  $(this).next().next().delay(300).fadeIn(300);	
  });
}); 



$(function() // run after page loads
{
  $(".xout").click(function()
  { // first click hides login form, shows password recovery
  $(".responses2").show(); 
  $(".responses2").css({backgroundColor: ''}); 
  $(".box2").hide();
  $(".box3").hide();
  $(".introBAS").delay(500).fadeIn(300);  
  $(".content2").fadeOut(300);
  $(".content1").fadeOut(300);				 
  });
}); 

$(function() // run after page loads
{
  $("#bottomBarBG").toggle(function()
  {
  $(".commentBoxWrapper").hide();					
  },
  function()
  {
  $(".commentBoxWrapper").show();					
  });
}); 

$(function() // run after page loads
{
  $(".mainSchoolTitleContainer2").click(function()
  { // first click hides login form, shows password recovery
  $(".mainSchoolTitleContainer2").hide(); 
  $(".previews").css({"backgroundColor":''}); 
  $(".postCloseContainer").show();  
  $("#addCommentForm").slideToggle(400);
  $(".addItem").show();
  $(".sellingWrapper").show();		
  $(".titleValue").delay(400).focus();	  
  });
}); 

$(function() // run after page loads
{
  $(".postCloseContainer").click(function()
  { // first click hides login form, shows password recovery
  $(".postCloseContainer").hide();
  $(".mainSchoolTitleContainer2").show();  
  $("#addCommentForm").slideToggle(400); 
  });
}); 

$(function() // run after page loads
{
  $(".close").click(function()
  { // first click hides login form, shows password recovery
  $(".fullViewRespond").fadeOut(400);
  $(".previews").css({"backgroundColor":""});  
  });
}); 

$(function() // run after page loads
{
  $(".joW").hover(function()
  { // first click hides login form, shows password recovery
  $(".Jobs").show();		
  $(this).css({backgroundColor: '#aaa'})     
  $(this).css({color: '#000'})   
  },
  function()
  { // next click shows login form, hides password recovery
  $(".Jobs").hide();	
  $(this).css({backgroundColor: ''})  
  $(this).css({color: ''})   
  });
}); 

$(function() // run after page loads
{
  $(".previews").click(function()
  { // first click hides login form, shows password recovery
  $(this).prev().css({backgroundColor: "#eff2f7"}); 
  $('.previews').show()
  $('.closePreviews').hide();   
  $(this).prev().show(); 
  $(this).hide();
  $(".fullViewRespond").fadeOut(300);				
  $(this).next().delay(100).fadeIn(200);	
  });
}); 
	
$(function() // run after page loads
{
  $(".closePreviews").click(function()
  { // first click hides login form, shows password recovery
  $(this).hide()
  $(this).next().show()			
  $(this).next().next().fadeOut(200);	
  });
});   

 
$(document).ready(function() { 
 
  //select all the a tag with name equal to modal
  $('a[name=modal]').click(function(e) {
    //change post id to relative greeting id
    $('#respondButtonHidden').val($(this).attr('id'));
    
    $('#responseTextField').focus();
    //Cancel the link behavior
    e.preventDefault();
    //Get the A tag
    var id = $(this).attr('href');
   
    //Get the screen height and width
    var maskHeight = $(document).height();
    var maskWidth = $(window).width();
   
    //Set height and width to mask to fill up the whole screen
    
    
    //transition effect   
       
    $('#mask').fadeTo(300,0.2); 
   
    //Get the window height and width
    var winH = $(window).height();
    var winW = $(window).width();
                
   
    //transition effect
    $(id).fadeIn(300);
      
  });
   
  //if close button is clicked
  $('.window .close').click(function (e) {
    //Cancel the link behavior
    e.preventDefault();
    $('#mask, .window').hide();
    
  });    
   
  //if mask is clicked
  $('#mask').click(function () {
    $(this).hide();
    $('.window').hide();
  });        
   
});
 			